import request from '@/utils/request'
let url ='bpm'
export function getTodoTaskPage(query) {
  return request({
    url: `/${url}/bpm/task/todo-page`,
    method: 'get',
    params: query
  })
}

export function getDoneTaskPage(query) {
  return request({
    url: `/${url}/bpm/task/done-page`,
    method: 'get',
    params: query
  })
}

export function completeTask(data) {
  return request({
    url: `/${url}/bpm/task/complete`,
    method: 'PUT',
    data: data
  })
}

export function approveTask(data) {
  return request({
    url: `/${url}/bpm/task/approve`,
    method: 'PUT',
    data: data
  })
}

export function rejectTask(data) {
  return request({
    url: `/${url}/bpm/task/reject`,
    method: 'PUT',
    data: data
  })
}

export function updateTaskAssignee(data) {
  return request({
    url: `/${url}/bpm/task/update-assignee`,
    method: 'PUT',
    data: data
  })
}

export function getTaskListByProcessInstanceId(processInstanceId) {
  return request({
    url: `/${url}/bpm/task/list-by-process-instance-id?processInstanceId=${processInstanceId}`,
    method: 'get',
  })
}
